const mongoose = require('mongoose');//引入mongoose
const completedQuestionsSchema = new mongoose.Schema({
    user_answer:String,
    questions_id:{
        type: mongoose.SchemaTypes.ObjectId,
        //关联集合模型，集合模型名在mongoose.model注册的名字
        ref:'questionsModel'
    },
    user_id: {
        type: mongoose.SchemaTypes.ObjectId,
        //关联集合模型，集合模型名在mongoose.model注册的名字
        ref:'userModel'
    },
    test_id: {
        type: mongoose.SchemaTypes.ObjectId,
        //关联集合模型，集合模型名在mongoose.model注册的名字
        ref:'testModel'
    }
});

const completedQuestionsModel = mongoose.model("completedQuestionsModel", completedQuestionsSchema, "completedQuestions");
module.exports = {completedQuestionsModel}